package com.fp.m7.api.model;

public abstract class AbstractEntity implements EntityBase {
	private static final long serialVersionUID = 1L;

	protected Long id;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return String.format("AbstractEntity [id=%s]", id);
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof AbstractEntity) {
			AbstractEntity that = (AbstractEntity) obj;
			return that.id != null && that.id.equals(this.id);
		}
		return false;
	}

	@Override
	public int hashCode() {
		return id == null ? 0 : id.intValue() * 317;
	}
}
